<?php defined('SYSPATH') or die('No direct access allowed.');
 
class Model_Category extends ORM {
    protected  $_table_name = 'category';
    protected $_has_many = array(
        'Devices' => array(
            'model'       => 'Device',
            'foreign_key' => 'category_id',
        ),
    );
    
    public function rules()
    {
        return array(
            'name' => array(
                array('not_empty'),
            ),
            'description' => array(
                array('not_empty'),
            ),
        );
    }    
}
